<!-- 商城 - 购物车悬浮组件 -->
<template>
	<view class="vk-mall-goods-cart-float" @click.stop="pageToCart">
		<u-icon name="vk-mall-icon-gouwuche" size="70"></u-icon>
		<u-badge type="error" :count="cartTotalCom" :offset="[20,30]"></u-badge>
	</view>
</template>

<script>
export default {
	name: "vk-mall-goods-cart-float",
	props: {
		list:{
			Type:Array,
			default:function(){
				return [];
			}
		}
	},
	data: function() {
		// 组件创建时,进行数据初始化
		return {};
	},
	mounted() {
		this.init();
	},
	methods: {
		// 初始化
		init() {},
		pageToCart(){
			uni.vk.navigateTo('/pages/goods/goods-cart');
		}
	},
	// 监听器
	watch:{

	},
	// 计算属性
	computed: {
		cartTotalCom(){
			return vk.myfn.cart.getTotal();
		}
	}
};
</script>

<style lang="scss" scoped>
	.vk-mall-goods-cart-float {
		width: 100rpx;
		height: 100rpx;
		position: fixed;
		display: flex;
		justify-content: center;
		align-items: center;
		right:30rpx;
		top:700rpx;
		z-index: 999;
		background-color:#ffffff;
		border-radius: 50%;
		color: #ffffff;
		box-shadow: 0px 1px 6px 6px #cbcbcb;
	}
</style>
